<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>带参数的ajax请求</title>
    <script src="js/jquery-3.2.1.min.js"></script>
</head>
<body>
<input type="number" class="text">
<input type="button" value="发送带参数的ajax请求" class="btn">
<div class="ctn"></div>
<script>
    $(".btn").click(function () {
        //带参数的ajax请求
        $.ajax({
            url:"http://172.16.16.63:8081/stu",
            data:{
                sid:$(".text").val(),
                aaaa:333
            },
            success:function (re) {
                //回调函数:当请求成功之后要执行的代码
                console.log(re);
                $(".ctn").html(re.sname);
            }
        })
        console.log("aaa");
    })
</script>
</body>
</html>